package org.projectback.entity.AccountEntity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.annotation.PostConstruct;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@TableName("AccountData")
@AllArgsConstructor
@NoArgsConstructor
public class Account {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField("username")
    private String username;
    @TableField("email")
    private String email;
    @TableField("phone")
    private String phone;
    @TableField("password")
    private String password;
    @TableField("role")
    private String role;

    public Account(String username, String email, String phone, String password, String role) {
        this.username = username;
        this.email = email;
        this.phone = phone;
        this.password = password;
        this.role = role;
    }

    @PostConstruct()
    public void init(String username) {
        System.out.println(username);
    }
}
